<?php 
/*
 module:		测试题列表验证器
 create_time:	2021-09-02 22:23:58
 author:		
 contact:		
*/

namespace app\admin\validate\Test;
use think\validate;

class Topic extends validate {


	protected $rule = [
		'title'=>['require'],
		'img'=>['require'],
		'price'=>['regex'=>'/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/'],
	];

	protected $message = [
		'title.require'=>'测试标题不能为空',
		'img.require'=>'测试封面不能为空',
		'price.regex'=>'价格设置格式错误',
	];

	protected $scene  = [
		'add'=>['title','img','price'],
		'edit'=>['title','img','price'],
	];



}

